#ifndef GLVIEW_H
#define GLVIEW_H

#include <GL/glew.h>

#include <QShortcut>
#include <QTimer>
#include <QLabel>

#include <QGLWidget>
#include "Entity.h"
#include "GLContext.h"
#include "Material.h"
#include "UniformMat4.h"
#include "View.h"
#include "QKeyEvent"
#include <GeoTool/Matrix.h>
#include "QDebug"
#include <QMouseEvent>
#include "Image.h"
#include "SceneGraph.h"
#include <QTime>
#include "TrackView.h"



/*******************************************
 *      @brief La classe Gl view hérite de QGLWidget et sert à afficher une scene opengl
 *      à l'intérieur d'un widget qt
 *****************************************************/
class GLView : public QGLWidget
{
    Q_OBJECT

    public:
    GLView();
    QLabel * label;
    float valueTest;

    SceneGraph *    scene;
    GLContext   *   context;
    Mesh        *   mesh;

    QTime       * time;
    int         delta;
    int         lastTime;
    protected :

    virtual void initializeGL();
    virtual void paintGL();
    virtual void resizeGL(int w, int h);

    int anchorX;
    int anchorY;
    Image * img;
    bool pressed;

    TrackView   *   trackview;
    View * viewEntity;
    int starttime     ;
    int timeInterval  ;
    int     frameCount  ;

    void mouseMoveEvent(QMouseEvent * event);
    void mouseReleaseEvent(QMouseEvent * event);
    void keyPressEvent(QKeyEvent * key);




    public slots:

        void Refresh();



};


#endif // GLVIEW_H
